Which player this console is: 1 to 4. It is 0 until another console has been heard, because a console only learns its place on the cable from the first message it receives. Players are numbered 1 to 4 by where they sit on the cable, and player 1 is the console with the cable’s small purple plug in it.
Works differently on Game Boy - The Game Boy link cable joins two consoles, not four: players 3 and 4 are never there and read as not pressing anything, and the two consoles decide between themselves which one is player 1, so it can be a different one each time they meet.
Works differently on Game Boy Color - The Game Boy Color link cable joins two consoles, not four: players 3 and 4 are never there and read as not pressing anything, and the two consoles decide between themselves which one is player 1, so it can be a different one each time they meet.
On other consoles this differs: see Side by side and How the consoles differ.
link_player() -> intint
Which player this console is: 1 to 4. It is 0 until another console has been heard, because a console only learns its place on the cable from the first message it receives.
Players are numbered by where they sit on the cable. Player 1 is the console with the cable's small purple plug in it.
Both consoles run the same game, so this is how the same code puts one player's ship on the left of one screen and the other's on the left of the other. Every console asks "which one am I?", and everything else follows from the answer.
var me = link_player();
if (me == 1) {
draw_text(8, 8, "YOU ARE THE RED SQUARE");
}Says so on the screen of whichever console is player 1. On the other console, me is 2, and nothing is drawn.
Players are numbered 1 to 4 by where they sit on the cable, and player 1 is the console with the cable’s small purple plug in it. Both consoles run the same game, so this is how the same code puts the first player’s ship on the left of one screen and the second player’s on the left of the other: every console asks "which one am I?" and everything else follows from the answer.